package com.data.collect.logic;

/**
 * Created by wanggenlin on 17-6-5.
 */
public class JavaParamController {

    private static JavaParamController instance;

    public static JavaParamController getInstance() {
        if (instance == null){
            instance = new JavaParamController();
        }
        return instance;
    }


    /** OS版本号
     *
     * @return
     */
    public String osVersion(){
        return  System.getProperty("os.version");
    }



    /** OS名称  
     *
     * @return
     */
    public String osName(){
        return  System.getProperty("os.name");
    }

    /** OS架构  
     *
     * @return
     */
    public String osArch(){
        return  System.getProperty("os.arch");
    }

    /** home属性  
     *
     * @return
     */
    public String userHome(){
        return  System.getProperty("user.home");
    }

    /** name属性  
     *
     * @return
     */
    public String userName(){
        return  System.getProperty("user.name");
    }

    /** dir属性
     *
     * @return
     */
    public String userDir(){
        return  System.getProperty("user.dir");
    }


    /** 时区
     *
     * @return
     */
    public String userTimezone(){
        return  System.getProperty("user.timezone");
    }



    /** 路径分隔符  
     *
     * @return
     */
    public String pathSeparator(){
        return  System.getProperty("path.separator");
    }


    /** 行文分隔符
     *
     * @return
     */
    public String lineSeparator(){
        return  System.getProperty("line.separator");
    }

    /** 文件分隔符
     *
     * @return
     */
    public String fileSparator(){
        return  System.getProperty("file.separator");
    }

    /** Java vender URL属性  
     *
     * @return
     */
    public String vendorUrl(){
        return  System.getProperty("java.vendor.url");
    }

    /**Java Class路径  
     *
     * @return
     */
    public String classPath(){
        return  System.getProperty("java.class.path");
    }

    /**JJava class版本
     *
     * @return
     */
    public String classVersion(){
        return  System.getProperty("java.class.version");
    }

    /** java vender 属性  
     *
     * @return
     */
    public String vendor(){
        return  System.getProperty("java.vendor");
    }


    /**Java 版本  
     *
     * @return
     */
    public String version(){
        return  System.getProperty("java.version");
    }

    /**Java Home 属性
     *
     * @return
     */
    public String home(){
        return  System.getProperty("java.home");
    }


    @Override
    public String toString() {
        return
                "\n osVersion = "+osVersion()+
                "\nosName = "+osName()+
                "\nosArch = "+osArch()+
                "\nuserHome = "+userHome()+
                "\nuserName = "+userName()+
                "\nuserDir = "+userDir()+
                "\nuserTimezone = "+userTimezone()+
                "\npathSeparator = "+pathSeparator()+
                "\nlineSeparator = "+lineSeparator()+
                "\nfileSparator = "+fileSparator()+
                "\nvendorUrl = "+vendorUrl()+
                "\nclassPath = "+classPath()+
                "\nclassVersion = "+classVersion()+
                "\nvendor = "+vendor()+
                "\nversion = "+version()+
                "\nhome = "+home()
                ;
    }
}
